@{
    ViewData["Title"] = "编辑";
    Layout = "~/Areas/Manager/Views/Shared/_Layout.cshtml";
}
@model Sykj.Entity.HotKeyWords
<div class="layui-bg">
    <form class="layui-form" style="padding: 20px 30px 0 0;" method="post">
        <input type="hidden" asp-for="Id" lay-verify="required" class="layui-input">
        <div class="layui-form-item">
            <label class="layui-form-label">关键字</label>
            <div class="layui-input-block">
                <input type="text" asp-for="KeyWords" name="KeyWords"  lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">商品分类</label>
            <div class="layui-input-block" id="parent">
                <input type="hidden" id="ParentCategoryId" asp-for="CategoryId" name="CategoryId" lay-verify="required" />
                <input type="text" id="ParentName" asp-for="CateName" class="layui-input" autocomplete="off" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="edit" id="submit" type="button">提交</button>
                <button id="close" type="button" class="layui-btn layui-btn-primary">关闭</button>
            </div>
        </div>
    </form>
</div>
@section scriptsfeet
{
    <script type="text/javascript">
        layui.config({
            base: '/layuiadmin/' //静态资源所在路径;
        }).use(['form', 'sykjwh'], function () {

            var $ = layui.$, form = layui.form, sykjwh = layui.sykjwh;

            $("#close").click(function () {
                sykjwh.close();
            });

            //表单提交
            form.on('submit(edit)', function (obj) {
                sykjwh.save('@Url.Action("HotKeyWordsEdit", "Ms", new { area = Constant.AREAMANAGER })', obj.field);
            });

            $("#parent").click(function () {
                sykjwh.open('商品分类', '@Url.Action("CategoriesTreeList", "Ms", new {area = Constant.AREAMANAGER})', 400, 500);
            });
        });
    </script>
}
